package test.patterns;

/** Subject role in the Observer pattern

   Responsibilities:
			
   1) To maintain a set of observers
   2) To invoke all observers' update method whenever
      this object's state changes

 
   This source code is from the book 
     "Flexible, Reliable Software:
       Using Patterns and Agile Development"
     published 2010 by CRC Press.
   Author: 
     Henrik B Christensen 
     Computer Science Department
     Aarhus University
   
   This source code is provided WITHOUT ANY WARRANTY either 
   expressed or implied. You may study, use, modify, and 
   distribute it for non-commercial purposes. For any 
   commercial use, see http://www.baerbak.com/
*/

public interface ObsSubject {
  /** add an observer to the set of observers receiving notifications
   * from this subject.
   * @param newObserver the observer to add to this subject's set */
  public void addObserver(ObsObserver newObserver);
  /**  Remove the observer from the set of observers receiving
   * notifications from this subject.
   * @param observer the observer to remove from the set.*/
  public void removeObserver(ObsObserver observer);
  /** notify all observers in case this subject has changed state. */
  public void notifyObservers();
}